/**
 * @Author: 肖科
 * @Date: 2019/11/25
 * @Last Modified by:   肖科
 * @Last Modified time: 2019-11-25 09:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 查询服务产品销售单
export const serviceSalesProject = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/queryServiceSalesProduct`, {params});

// 查询服务产品销售单明细
export const serviceSalesProjectDetailed = id => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/queryServiceSalesDetailed/${id}`, {});

//  根据产品查询产品的维修项目
export const serviceProject = id => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/queryServiceProject/${id}`, {});

//  根据产品查询产品的维修备件
export const servicePart = id => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/queryServicePart/${id}`, {});

// 查询车主车辆相关信息
export const vehicleOwner = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/queryVin`, {params});

// 销售单新增和编辑
export const saveSalesProduct = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/saveSalesOrder`, params);

//  查询工时
export const labourPrice = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedataRepairtypes/labourpriceItem`, {params});

// 查询服务产品维护页面数据
export  const  queryServiceProducts = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/maintain`, {params});

// 删除服务单号
export const serviceSalesDeleted = (id,params) => axios.post(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/productDelete/${id}`, params);

// 服务产品导出
export const getExcelList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/serviceProjectSales/export`,
  { 
    params,
    responseType: 'arraybuffer'
  });

 